export function setStorageItem(k, v) {
  if (typeof v == "undefined" || v == null) {
    return;
  }

  let val = v;
  if (typeof v == "object") {
    val = JSON.stringify(v);
  }
  localStorage.setItem(k, val);
}

export function getStorageItem(k) {
  let val = localStorage.getItem(k);
  try {
    //如果是number boolean jsonstring是不会报错的
    return JSON.parse(val);
  } catch (e) {
    return val;
  }
}
export function delStorageItem(k) {
  localStorage.removeItem(k);
}
